<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAddressesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('addresses', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('member_id')->default(0)->unsigned()->comment('会员id');
            $table->string('name')->comment('收货人姓名');
            $table->integer('province_id')->unsigned()->comment('省');
            $table->integer('city_id')->unsigned()->comment('市');
            $table->integer('county_id')->unsigned()->comment('区、县');
            $table->integer('detail_area')->unsigned()->comment('详细地区');
            $table->integer('code')->unsigned()->comment('邮政编码');
            $table->string('tel_phone', '20')->comment('座机号码');
            $table->string('mob_phone', '15')->comment('手机号码');
            $table->tinyInteger('default')->comment('1默认收货地址');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('addresses');
    }
}
